import { setUserIdea } from '../../services/user';
Page({
  data: {
    searchinput: ''
  },
  onLoad() {
    my.setNavigationBar({
      title: '产品建议',
      backgroundColor: '#4BA3F9'
    })
  },
  bindFormSubmit(e) {
    if (e.detail.value.textarea.length <= 0) {
      my.showToast({
        type: 'fail',
        content: '请在这里输入您的问题',
        duration: 2000,
      });
      return
    }
    setUserIdea({ ideaRemark: e.detail.value.textarea }).then(res => {
      if (res.code == "000000") {
        my.showToast({
          type: 'success',
          content: '提交成功',
          duration: 2000,
        });
        this.setData({ searchinput: '' })
      }
    })
  },

});
